import axios from '@/utils/axios'

export const getCode = (id: string): Promise<ApiResult<SystemCodePO>> => {
  return axios.get(`system/code/${id}`)
}

export const getCodeListByDictId = (dictId: string): Promise<ApiResult<SystemCodePO[]>> => {
  return axios.get(`system/code/list/${dictId}`)
}

export const postOrPutCode = (data: SystemCodePO): Promise<ApiResult<null>> => {
  return axios.post(`system/code`, data)
}

export const deleteCode = (id: string): Promise<ApiResult<null>> => {
  return axios.delete(`system/code/${id}`)
}
